﻿using WMPLib;

namespace ScottLane.MediaFeeder.ObjectModel
{
    /// <summary>
    /// A Singleton-style class representing a Windows Media Player instance. This class should be used
    /// instead of the WindowsMediaPlayerClass to prevent multiple instances from being created.
    /// </summary>
    internal class MediaPlayer
    {
        private static readonly WindowsMediaPlayerClass instance = new WindowsMediaPlayerClass();

        /// <summary>
        /// Initializes a new instance of the MediaPlayer class.
        /// </summary>
        private MediaPlayer()
        {
        }

        /// <summary>
        /// Gets an instance of the WindowsMediaPlayerClass.
        /// </summary>
        public static WindowsMediaPlayerClass Instance
        {
            get
            {
                return instance;
            }
        }

    }
}
